#newl #sing set output=#path#name-album.mka|#newl #sing set output=#path#name-album#exte|#newl #sing set output=#path#name-album.opus|
#newl #sing set tempinfo=#pathtemp-info.txt
#newl #sing if exist "%tempinfo%" del "%tempinfo%"
#newl #sing if exist "%tempinfo%.len" del "%tempinfo%.len"
#newl #sing ECHO ;FFMETADATA1>>"%tempinfo%.len"
#newl ECHO file '#item'>>"%tempinfo%"
#newl echo [CHAPTER]>>"%tempinfo%.len"
#newl echo TIMEBASE=1/1>>"%tempinfo%.len"
#newl set start_time=%end_time%
#newl echo START=%start_time:~0,-2%>>"%tempinfo%.len"
#newl "#ppthapps\ffmpeg\ffprobe" -i "#item" -v quiet -of csv=p=0 -show_entries format=duration>>"%tempinfo%.len" > result.txt
#newl set /p end_time=<result.txt
#newl set end_time=%end_time:.=%
#newl set end_time=%end_time:~0,-4%
#newl set /a end_time=%start_time%+%end_time%
#newl del result.txt
#newl echo END=%end_time:~0,-2%>>"%tempinfo%.len"
#newl echo title=#name>>"%tempinfo%.len"
#newl #last "#ppthapps\ffmpeg\ffmpeg.exe" |--Path to file--
#last -f concat |--use concat protocol--
#last -i "%tempinfo%" |--list of files--
#last -i "%tempinfo%.len" -map_metadata 1 |--add metainfo chapters, mka output files only--
#REMARK add cover.jpg image, if you have it|-attach "#pathcover.jpg" -metadata:s mimetype="image/jpeg" -metadata:s filename="cover.jpg" |--attach cover image--
#last -c copy |--no reencoding--
#last "%output%" |--output with all the content--
#newl #last del "%tempinfo%" |--del list of files--
#newl #last del "%tempinfo%.len" |--del list of files--

<comment>
Drag and files to merge into one. New filename will have -album string added to it.
If you have cover.jpg, you can add it too. Change "#remark add cover.jpg image..." line.
If extension has more than 3 letters enter manually instead of #exte, in the 3rd line.
Fore example 'opus' vs 'ogg' three letters.
Files CANNOT HAVE ' in their names.
Check output file afterwards for length.


https://trac.ffmpeg.org/wiki/Concatenate



"#ppthapps\ffmpeg\ffprobe" -i "#item" -v quiet -of csv=p=0 -show_entries format=duration 

#newl set /p "=START=" <nul >>"%tempinfo%.len"&"#ppthapps\ffmpeg\ffprobe" -i ...

    %PATH:~-10%

would extract the last 10 characters of the PATH variable.

    %PATH:~0,-2%

would extract all but the last 2 characters of the PATH variable.